/**
 * 分类列表的JS
 */
//window.onscroll =function(){
//	alert('1111');
//};
var cur = 0;
var page=$(".product_more #fcmenu li").size();
if(parseInt(page)==4)
{
	page=0;
}
(function(){
var $copy_id = 'category_div';
var $copyed_id = 'category_div_copy';
$(window).bind('scroll',function(){
	$offset = $('#' + $copy_id ).position();
	$category_top = $offset.top;
	$document_offset = $(document).scrollTop();
	if ( $category_top < $document_offset ){
		if ( !document.getElementById( $copyed_id ) ){
			var $html = $('#' + $copy_id).clone();
			$html.attr('id', $copyed_id );
			$('body').append( $html );
			cateLocll();
		}
		$('#' + $copyed_id ).css({'position': 'absolute' , 'left' : $offset.left , 'top' : $document_offset });
	} else {
		$('#' + $copyed_id ).remove();
	}
});
})();

function trunRight(){
	cur+=1;
	if(cur >= page)
	{
		cur = page-1;
	}
	else
	{
	  $(".product_more .list").animate({"left":"-"+145*cur});
	}
}
function trunLeft(){
	  cur-=1;
	  if(cur < 0)
	  {
		  cur = 0;
	  }
	  else
	  {
	     $(".product_more .list").animate({"left":"-"+145*cur});
	  }
}